{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/UserProfile/index.tsx\",\n  _s = $RefreshSig$();\nimport React from \"react\";\nimport { Avatar, Name, UserStatus } from \"../index\";\nimport { getUserName } from \"../../utils/User\";\nimport { observer } from \"mobx-react-lite\";\nimport { Context } from \"../../index\";\nimport './UserProfile.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst UserProfile = props => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [selfProfile, setSelfProfile] = React.useState(false);\n  React.useEffect(() => {\n    if (props.profile.id == store.getProfile().id) {\n      setSelfProfile(true);\n    } else {\n      setSelfProfile(false);\n    }\n    console.log(selfProfile);\n  }, [props.profile]);\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"profile\",\n    children: [/*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"profile__header\",\n      children: /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"profile__header-wrapper\",\n        children: [/*#__PURE__*/_jsxDEV(Avatar, {\n          contentList: props.profile.content,\n          alt: getUserName(props.profile),\n          stringForFirstCharacter: getUserName(props.profile),\n          stringForGenerateColor: props.profile.id,\n          shortAvatar: false,\n          selfProfile: selfProfile\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 26,\n          columnNumber: 21\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"profile__header-infoName\",\n          children: [/*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"profile__header-infoName-wrap\",\n            children: [/*#__PURE__*/_jsxDEV(\"p\", {\n              children: \"\\u041F\\u043E\\u043B\\u044C\\u0437\\u043E\\u0432\\u0430\\u0442\\u0435\\u043B\\u044C: \"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 36,\n              columnNumber: 29\n            }, this), /*#__PURE__*/_jsxDEV(Name, {\n              user: props.profile\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 37,\n              columnNumber: 29\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 35,\n            columnNumber: 25\n          }, this), /*#__PURE__*/_jsxDEV(UserStatus, {\n            status: true\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 39,\n            columnNumber: 25\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 34,\n          columnNumber: 21\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 25,\n        columnNumber: 17\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 24,\n      columnNumber: 13\n    }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"profile__body\",\n      children: /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"profile__body-profile\",\n        children: [(props.profile.hideEmail === false || props.profile.hideEmail === undefined) && /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"profile__body-profile-field\",\n          children: /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"profile__body-profile-field-wrapper\",\n            children: [/*#__PURE__*/_jsxDEV(\"span\", {\n              children: \"Email:\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 50,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n              className: \"profile__body-profile-field-bold\",\n              children: props.profile.email\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 51,\n              columnNumber: 33\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 49,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 48,\n          columnNumber: 25\n        }, this) || /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"profile__body-profile-field--green\",\n          children: /*#__PURE__*/_jsxDEV(\"span\", {\n            className: \"profile__body-profile-field--green\",\n            children: \"Email \\u0431\\u044B\\u043B \\u0441\\u043A\\u0440\\u044B\\u0442\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 56,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 55,\n          columnNumber: 25\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"profile__body-profile-field\",\n          children: /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"profile__body-profile-field-wrapper\",\n            children: [/*#__PURE__*/_jsxDEV(\"span\", {\n              children: \"Nickname:\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 61,\n              columnNumber: 29\n            }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n              className: \"profile__body-profile-field-bold\",\n              children: props.profile.nickname\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 62,\n              columnNumber: 29\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 60,\n            columnNumber: 25\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 59,\n          columnNumber: 21\n        }, this), props.profile.firstName && /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"profile__body-profile-field\",\n          children: /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"profile__body-profile-field-wrapper\",\n            children: [/*#__PURE__*/_jsxDEV(\"span\", {\n              children: \"\\u0418\\u043C\\u044F:\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 68,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n              className: \"profile__body-profile-field-bold\",\n              children: props.profile.firstName\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 69,\n              columnNumber: 33\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 67,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 66,\n          columnNumber: 25\n        }, this), props.profile.lastName && /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"profile__body-profile-field\",\n          children: /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"profile__body-profile-field-wrapper\",\n            children: [/*#__PURE__*/_jsxDEV(\"span\", {\n              children: \"\\u0424\\u0430\\u043C\\u0438\\u043B\\u0438\\u044F:\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 76,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n              className: \"profile__body-profile-field-bold\",\n              children: props.profile.lastName\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 77,\n              columnNumber: 33\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 75,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 74,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 44,\n        columnNumber: 17\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 43,\n      columnNumber: 13\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 23,\n    columnNumber: 9\n  }, this);\n};\n_s(UserProfile, \"MPoROVrIYcD+LvhBSnlbeuzuYbI=\");\n_c = UserProfile;\nexport default _c2 = observer(UserProfile);\nvar _c, _c2;\n$RefreshReg$(_c, \"UserProfile\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Avatar","Name","UserStatus","getUserName","observer","Context","UserProfile","props","store","useContext","selfProfile","setSelfProfile","useState","useEffect","profile","id","getProfile","console","log","content","hideEmail","undefined","email","nickname","firstName","lastName"],"sources":["/data/messenger.client/src/components/UserProfile/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {UserProfileProps} from \"../../models/props/UserProfileProps\";\nimport {Avatar, Name, UserStatus} from \"../index\";\nimport {getUserName} from \"../../utils/User\";\nimport {observer} from \"mobx-react-lite\";\nimport {Context} from \"../../index\";\nimport './UserProfile.scss';\n\nconst UserProfile: React.FC<UserProfileProps> = (props) => {\n    const {store} = React.useContext(Context);\n    const [selfProfile, setSelfProfile] = React.useState<boolean>(false);\n\n    React.useEffect(() => {\n        if (props.profile.id == store.getProfile().id) {\n            setSelfProfile(true);\n        } else {\n            setSelfProfile(false);\n        }\n        console.log(selfProfile)\n    }, [props.profile]);\n\n    return (\n        <div className=\"profile\">\n            <div className=\"profile__header\">\n                <div className=\"profile__header-wrapper\">\n                    <Avatar\n                        contentList={props.profile.content}\n                        alt={getUserName(props.profile)}\n                        stringForFirstCharacter={getUserName(props.profile)}\n                        stringForGenerateColor={props.profile.id}\n                        shortAvatar={false}\n                        selfProfile={selfProfile}\n                    />\n                    <div className=\"profile__header-infoName\">\n                        <div className=\"profile__header-infoName-wrap\">\n                            <p>Пользователь: </p>\n                            <Name user={props.profile} />\n                        </div>\n                        <UserStatus status={true} />\n                    </div>\n                </div>\n            </div>\n            <div className=\"profile__body\">\n                <div className=\"profile__body-profile\">\n                    {\n                        ((props.profile.hideEmail === false ||\n                        props.profile.hideEmail === undefined) &&\n                        <div className=\"profile__body-profile-field\">\n                            <div className=\"profile__body-profile-field-wrapper\">\n                                <span>Email:</span>\n                                <span className=\"profile__body-profile-field-bold\">{props.profile.email}</span>\n                            </div>\n                        </div>\n                        ) ||\n                        <div className=\"profile__body-profile-field--green\">\n                            <span className=\"profile__body-profile-field--green\">Email был скрыт</span>\n                        </div>\n                    }\n                    <div className=\"profile__body-profile-field\">\n                        <div className=\"profile__body-profile-field-wrapper\">\n                            <span>Nickname:</span>\n                            <span className=\"profile__body-profile-field-bold\">{props.profile.nickname}</span>\n                        </div>\n                    </div>\n                    {(props.profile.firstName! &&\n                        <div className=\"profile__body-profile-field\">\n                            <div className=\"profile__body-profile-field-wrapper\">\n                                <span>Имя:</span>\n                                <span className=\"profile__body-profile-field-bold\">{props.profile.firstName}</span>\n                            </div>\n                        </div>\n                    )}\n                    {(props.profile.lastName! &&\n                        <div className=\"profile__body-profile-field\">\n                            <div className=\"profile__body-profile-field-wrapper\">\n                                <span>Фамилия:</span>\n                                <span className=\"profile__body-profile-field-bold\">{props.profile.lastName}</span>\n                            </div>\n                        </div>\n                    )}\n                </div>\n            </div>\n        </div>\n    );\n}\n\nexport default observer(UserProfile);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,MAAM,EAAEC,IAAI,EAAEC,UAAU,QAAO,UAAU;AACjD,SAAQC,WAAW,QAAO,kBAAkB;AAC5C,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,aAAa;AACnC,OAAO,oBAAoB;AAAC;AAE5B,MAAMC,WAAuC,GAAIC,KAAK,IAAK;EAAA;EACvD,MAAM;IAACC;EAAK,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACJ,OAAO,CAAC;EACzC,MAAM,CAACK,WAAW,EAAEC,cAAc,CAAC,GAAGZ,KAAK,CAACa,QAAQ,CAAU,KAAK,CAAC;EAEpEb,KAAK,CAACc,SAAS,CAAC,MAAM;IAClB,IAAIN,KAAK,CAACO,OAAO,CAACC,EAAE,IAAIP,KAAK,CAACQ,UAAU,EAAE,CAACD,EAAE,EAAE;MAC3CJ,cAAc,CAAC,IAAI,CAAC;IACxB,CAAC,MAAM;MACHA,cAAc,CAAC,KAAK,CAAC;IACzB;IACAM,OAAO,CAACC,GAAG,CAACR,WAAW,CAAC;EAC5B,CAAC,EAAE,CAACH,KAAK,CAACO,OAAO,CAAC,CAAC;EAEnB,oBACI;IAAK,SAAS,EAAC,SAAS;IAAA,wBACpB;MAAK,SAAS,EAAC,iBAAiB;MAAA,uBAC5B;QAAK,SAAS,EAAC,yBAAyB;QAAA,wBACpC,QAAC,MAAM;UACH,WAAW,EAAEP,KAAK,CAACO,OAAO,CAACK,OAAQ;UACnC,GAAG,EAAEhB,WAAW,CAACI,KAAK,CAACO,OAAO,CAAE;UAChC,uBAAuB,EAAEX,WAAW,CAACI,KAAK,CAACO,OAAO,CAAE;UACpD,sBAAsB,EAAEP,KAA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